import React from 'react';
//1. 引入 Route, BrowserRouter组件
import { Route, BrowserRouter } from 'react-router-dom';
import Home from './components/Home';
import Admin from './components/Admin';
//创建根组件 App
export default class App extends React.Component{
    render(){
        return <div>
            <BrowserRouter>
                {/* 2. 添加路由规则 */}
                <Route path="/home" component={Home} />
                <Route path="/admin" component={Admin} />
            </BrowserRouter>
        </div>
    }
}
